﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;

namespace BookingManagementSystem.Models
{
    public class BookingModel
    {
        public int Id { get; set; }
        [Required]
        [Display(Name = "Customer")]
        public int CustomerId { get; set; }
        [Required]
        [Display(Name = "Room")]
        public int RoomId { get; set; }
        [Required]
        [Display(Name = "Origin")]
        public int OriginId { get; set; }
        [Required]
        [Display(Name = "Check In")]
        public DateTime CheckInDate { get; set; }
        [Required]
        [Display(Name = "Check Out")]
        public DateTime CheckOutDate { get; set; }

        public List<SelectListItem> AllCustomers { get; set; }
        public List<SelectListItem> AllRooms { get; set; }
        public List<SelectListItem> AllOrigins { get; set; }

        public BookingModel()
        {
            Id = 0;
            CustomerId = 0;
            RoomId = 0;
            OriginId = 0;
            DateTime startDate = DateTime.Now;
            CheckInDate = startDate;
            CheckOutDate = startDate.AddHours(1);
        }
            
        public BookingModel(List<SelectListItem> customers, List<SelectListItem> rooms, List<SelectListItem> origins): this()
        {
            AllCustomers = customers;
            AllRooms = rooms;
            AllOrigins = origins;
        }
    }
}